package com.example.vspm.mapper;

import com.example.vspm.entity.Receiver;
import org.apache.ibatis.annotations.*;
import org.springframework.stereotype.Repository;

import java.util.List;

/**
 * @author LCL
 * @date 2022/3/13
 * @desc
 */
@Repository
@Mapper
public interface ReceiverMapper {


    /////////////////////////////////查看接单员 ,派单
    @Select("select * from vspm_receiver")
    List<Receiver> selectReceiver();

    ////////////////////////////操作工单表查看相应的工单且拒绝后
    //根据登录的session的id,更新接单员表的订单拒绝数量
    @Update("update  vspm_receiver set refuseCount=refuseCount+1 WHERE pid3=#{pid3}")
    void updateRefuseCount(@Param("pid3")int pid3);

    //根据登录的session的id,更新接单员表的订单评分次数
    @Update("update  vspm_receiver set scoreCount=scoreCount+1 WHERE pid3=#{pid3}")
    void updateScoreCount(@Param("pid3")int pid3);

    ////根据前端传过来的评分,以及通过sendtable获取的pid3来更新评分
    @Update("update  vspm_receiver set score=score+#{score} WHERE pid3=#{pid3}")
    void updateScore(@Param("score")float score,@Param("pid3") int pid3);



}
